﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AnesSystem.Models;
using System.Collections.ObjectModel;
using AnesSystem.Services;
using AnesSystem.ViewModels;
using AnesSystem.Controls;
using System.Windows.Controls;

namespace AnesSystem.ViewModels
{
    public class PacuRealTimeSignMainShowCtrlViewModel : BaseViewModel<PacuRealTimeSignMainShowCtrlViewModel>
    {
        #region Variables
        private PatientLinkModel _patientLinkModel;

        #endregion


        #region Constructor
        public PacuRealTimeSignMainShowCtrlViewModel()
        {
        
        }


        #endregion


        #region Properties
        public PatientLinkModel PatientLinkModel
        {
            get
            {
                return _patientLinkModel;
            }

            set
            {
                _patientLinkModel = value;
            }
        }

     


        #endregion


        #region 依赖属性


        #endregion


        #region Event


        #endregion


        #region PrivateMethods



        #endregion


        #region Public/ProtectedMethods

        public void AddConfigVitalSign(ConfigVitalSignsModel configVitalSignsModel)
        {
            OperationDataPool.Instance.CurOperationData.VitalSignDataCache.AddConfigParam(configVitalSignsModel);
            for (int i = 1; i <= DataManager.Instance.CurrentPatientLink.Status.PacuPage; i++)
            {
                (DataManager.Instance.PacuRecordCtrl.ViewModel as PacuRecordCtrlViewModel).PacuRecordCtrlViewModels[i].PacuRealTimeSignShowCtrlViewModel.AddShowSigns(configVitalSignsModel);
                (DataManager.Instance.PacuRecordCtrl.ViewModel as PacuRecordCtrlViewModel).PacuRecordCtrlViewModels[i].PacuRealTimeItemCtrlViewModel.AddVitalItemByCode(configVitalSignsModel);
            }
        }

        public void RemoveConfigVitalSign(ConfigVitalSignsModel configVitalSignsModel)
        {
            OperationDataPool.Instance.CurOperationData.VitalSignDataCache.RemoveConfigParam(configVitalSignsModel);
            for (int i = 1; i <= DataManager.Instance.CurrentPatientLink.Status.PacuPage; i++)
            {
                (DataManager.Instance.PacuRecordCtrl.ViewModel as PacuRecordCtrlViewModel).PacuRecordCtrlViewModels[i].PacuRealTimeSignShowCtrlViewModel.RemoveShowSigns(configVitalSignsModel);
                (DataManager.Instance.PacuRecordCtrl.ViewModel as PacuRecordCtrlViewModel).PacuRecordCtrlViewModels[i].PacuRealTimeItemCtrlViewModel.RemoveVitalItemBy(configVitalSignsModel.code);
            }

        }
        public override void Refresh()
        {
            PacuRealTimeSignLeftCtrlViewModel.Instance.Refresh();
        }


        #endregion


        #region EventHandlers


        #endregion
    }
}
